package org.jeecg.modules.common.basevo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.jeecg.config.mybatis.TenantContext;
import org.jeecg.modules.common.utils.DateUtil;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="基础查询对象", description="BaseQueryVo")
public class BaseVo {

    /**自增ID*/
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "自增ID")
    private String id;
    /**学校编码（租户id）*/
    @Excel(name = "学校编码（租户id）", width = 15)
    @ApiModelProperty(value = "学校编码（租户id）")
    @Dict(dicCode = "id",dicText = "name",dictTable = "sys_tenant")
    public String tenantId =  TenantContext.getTenant() ;


    /**部门编码*/
    @Excel(name = "部门编码", width = 15)
    @ApiModelProperty(value = "部门编码")
    @Dict(dicCode = "org_code",dicText = "depart_name",dictTable = "sys_depart")
    public String sysOrgCode;



    /**0表示未删除,1表示删除*/
    @Excel(name = "0表示未删除,1表示删除", width = 15)
    @ApiModelProperty(value = "0表示未删除,1表示删除")
    @Dict(dicCode = "del_flag")
    public Integer delFlag=0;
    /**创建人*/
    @ApiModelProperty(value = "创建人")
    @Dict(dicCode = "id",dicText = "realname",dictTable = "sys_user")
    public String createBy;
    /**创建时间*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "创建时间")
    public Date createTime= DateUtil.getCurrentDate();
    /**修改人*/
    @ApiModelProperty(value = "修改人")
    @Dict(dicCode = "id",dicText = "realname",dictTable = "sys_user")
    public String updateBy;
    /**修改时间*/
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @ApiModelProperty(value = "修改时间")
    public Date updateTime=DateUtil.getCurrentDate();




}
